<style scoped>
.logo-img{
  /* width: 14px; */
  position: absolute;
  top:6px;
  left: 30px;
}
</style>

<template>
  <el-container>
    <!--从这里开始是头部-->

      <!-- 页面主题section -->
      <el-container>
        <div style="width:100%">
          <transition appear>
            <router-view></router-view>
          </transition>
        </div>
      </el-container>
    </el-container>

</template>
<style>
@import "assets/css/header.css";
.el-header {
  background-color: #b3c0d1;
  color: #333;
  line-height: 60px;
  padding: 0px;
  position: relative;
  z-index: 4;
  position: absolute;
  width: 100%;
  top: 0;
}
</style>

<script>
import Vue from 'vue'
export default {
  // 提供reload方法
  provide: function () {
    return {
      reload: this.reload
    }
  },
  data () {
    return {
      // isRouterAlive控制显示
      isRouterAlive: true,
      activeIndex: '',
      isCollapse: false,
      //
      width: '0px',
      //
      height: '0px',
      routePath: '/'
    }
  },
  mounted: function () {
    let _this = this
    Vue.set(_this, 'width', document.documentElement.clientWidth + 'px')
    Vue.set(_this, 'height', document.documentElement.clientHeight - 65 + 'px')
    this.activeIndex = this.$route.path
    //  this.$store.dispatch('mapUpdateSize', null)
    // 监听窗口大小
    window.onresize = function () {
      Vue.set(_this, 'width', document.documentElement.clientWidth + 'px')
      Vue.set(
        _this,
        'height',
        document.documentElement.clientHeight - 60 + 'px'
      )
    }
    // window.onpopstate = () => {
    //   if (!this.allowBack) { //    这个allowBack 是存在vuex里面的变量
    //     history.go(1)
    //   }
    // }
  },
  methods: {
    exit () {
      let _this = this
      this.$confirm('您确定要退出吗？！', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        localStorage.clear()
        _this.$router.push('/Login')
      })
    },
    map () {
      let _this = this
      _this.$router.push('/App/MapPage')
      // location.reload()
    }
  }
}
</script>
